package com.example.minzhengtong.ui

import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.example.minzhengtong.Const
import com.example.minzhengtong.MainActivity
import com.example.minzhengtong.base.BaseA
import com.example.minzhengtong.databinding.ActivitySettingBinding
import com.example.minzhengtong.utils.SpUtil
import com.gyf.immersionbar.ImmersionBar


class SettingA : BaseA() {

    companion object{
        fun enterThis(context: Activity){
            val intent = Intent(context,SettingA::class.java)
            context.startActivityForResult(intent,100)
        }
    }

    private lateinit var binding : ActivitySettingBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivitySettingBinding.inflate(layoutInflater)
        setContentView(binding.root)
        setToolBarVisiabale(false)
        ImmersionBar.with(this)
            .titleBar(binding.titleBar)
            .statusBarDarkFont(true)
            .init()
        binding.exit.setOnClickListener {
            SpUtil.getInstance().deleteData(Const.TOKEN)
            setResult(RESULT_OK)
            finish()
        }
    }

}